#include <string>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#pragma comment(lib, "ws2_32.lib")
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#endif

#include <libssh2.h>

#include "LoggerStream.hpp"

#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif

#define FDLOG(x) (LocalRollLogger::getInstance()->logger(x)->any())
#define LOG_SHELL_DEBUG FDLOG("SSHProjectTest_shell.txt") << FILE_FUNC_LINE << "|"

namespace nsshell {
    namespace network
    {
        int Shell_Init();
        void Shell_Exit();
        class Shell
        {
        public:
            static Shell* Inst()
            {
                static Shell inst;

                return &inst;
            }
            int execute(int argc, char* argv[]);
            static void kbd_callback(const char* name, int name_len,
                const char* instruction, int instruction_len,
                int num_prompts,
                const LIBSSH2_USERAUTH_KBDINT_PROMPT* prompts,
                LIBSSH2_USERAUTH_KBDINT_RESPONSE* responses,
                void** abstract);

        private:
            static const char* pubkey;
            static const char* privkey;
            static const char* username;
            static const char* password;
        };
    }
}

